home *** CD-ROM | disk | FTP | other *** search
/ Aminet 45 / Aminet 45 (2001)(GTI - Schatztruhe)[!][Oct 2001].iso / Aminet / game / role / ldmud-3.2-bin.lha / mud / doc / efun / query_verb < prev    next >
Text File  |  2001-04-06  |  926b  |  30 lines

  1. SYNOPSIS
  2.         string query_verb(void)
  3.  
  4. DESCRIPTION
  5.         Give the name of the current command, or 0 if not executing
  6.         from a command. This allows add_action() of several commands
  7.         to the same function. query_verb() returns 0 when invoked by a
  8.         function which was started by a call_out or the heart beat.
  9.         Also when a user logs in query_verb() returns 0.
  10.  
  11.         The string returned is always the first word from the line
  12.         input by the player, up to but not including the first space
  13.         (or lineend).
  14.  
  15. EXAMPLE
  16.         void init() {
  17.            ...
  18.            add_action("sing","sing");
  19.            ...
  20.         }
  21.         int sing(string str) {
  22.            write("Your command was:"+query_verb()+(str ? str : "")+"\n");
  23.            return 1;
  24.         }
  25.         
  26.         When ever you type "sing ..." you get "Your command was: sing ...".
  27.  
  28. SEE ALSO
  29.         add_action(E), query_command(E)
  30.